import request from '@/common/request.js'
import { formatGetUri } from '@/common/util.js'

const api = {}
/*
*
* @ api.register params
* url 请求路径
* method 请求方法 必须大写，为了兼容其他应用
* data  请求数据
* power 请求方式
*/
// POST请求方式
api.register = params => request.globalRequest(`/mobile/signUp`, 'POST', params, 1)
// GET请求方式

/*
*登录页面一系列接口
*/
api.register = params => request.globalRequest(`/mobile/signUp${formatGetUri(params)}`, 'GET',{}, 1)

//用户登录
api.autoLign = params => request.globaSignIn(`/program/login`, 'POST', params)
//获取验证码
api.getMsgCode = params => request.globaSignIn(`/program/gain/code/${params}`, 'POST', {})


//登录后请求需要token

/***************************首页页面一系列的接口*************************************/
//获取推广中心
api.getExtension = () => request.globalRequest(`/program/extension/core`, 'GET', {})
//个人业绩及排名
api.getExtIncome = () => request.globalRequest(`/program/extension/income`, 'GET', {})
//获取推广nav
// api.getProNav = () => request.globalRequest(`/program/extension/productList`, 'GET', {})
//查询推广图/program/extension/pushPage
// api.getProList = params => request.globalRequest(`/program/extension/pushPage${formatGetUri(params)}`, 'GET', {})
 api.getProList = params => request.globalRequest(`/program/extension/appPushPage`, 'GET', params)
//搜索_数据,且添加搜索记录
api.dtgSearch = params => request.globalRequest(`/program/extension/search${formatGetUri(params)}`, 'GET',{})
//获取搜索记录
api.getSearList = params => request.globalRequest(`/program/extension/searchRecord${formatGetUri(params)}`, 'GET', {})
//删除搜索记录
api.delSearList = () => request.globalRequest(`/program/extension/searchDel`, 'DELETE', {})
//根据id查询团队详情
api.getTeamBySuperId = params => request.globalRequest(`/program/team/bySuperId/${params}`, 'GET', {})



/***************************产品页面一系列的接口*************************************/
//根据id获取产品线列表
api.getProductListById = params => request.globalRequest(`/program/product/list/${params}`, 'GET',{})
//根据产品id查询产品介绍
api.getProductIntroById = params => request.globalRequest(`/program/product/bayId/${params}`, 'GET',{})
//根据产品id,获取所有带上二维码的推广图
api.getGeneralizeList = params => request.globalRequest(`/program/product/getGeneralizeList/${params}`, 'GET',{})
//根据params 查询已经注册用户,业绩展示
api.getRegisterShow = params => request.globalRequest(`/program/product/registerShow${formatGetUri(params)}`, 'GET',{})
//推广注册返回专属二维码图片,带推广注册页面地址
// api.getRegisterCode = params => request.globalRequest(`/program/product/getRegisterCode`, 'GET',{})
api.getRegisterCode = params => request.globalRequest(`/program/product/getAppRegisterCode`, 'GET',{})


/***************************经纪人学院页面一系列的接口*************************************/
//获取栏目
api.getSchoolColumn = () => request.globalRequest(`/brokerSchool/column`, 'GET', {})
//根据栏目id,页面栏目list
api.getSchoolList = params => request.globalRequest(`/brokerSchool/content`, 'GET',params)
//根据id查询详细文章内容
api.getArtDetail = params => request.globalRequest(`/brokerSchool/contentInfo/${params}`, 'GET',{})

/***************************专享房源一系列的接口*************************************/
//获取房源详情
api.getHousingDetail = (id) => request.globalRequest(`/housing/contentInfo/${id}`, 'GET', {})
api.getHouseColumn = () => request.globalRequest(`/housing/column`, 'GET', {})

api.getHouseList = params => request.globalRequest(`/housing/content${formatGetUri(params)}`, 'GET',{})


/***************************赚钱分享社区一系列的接口*************************************/
//获取赚钱分享社区列表
api.getForumList = params => request.globalRequest(`/program/forum/page${formatGetUri(params)}`, 'GET',{})
//添加一条内容
api.addForum = params => request.globalRequest(`/program/forum/addForumContent`, 'POST', params)
//查询一条内容的详细信息
api.getForumDetail = params => request.globalRequest(`/program/forum/selectById/${params}`, 'GET', )
//点赞,取消帖子
api.praiseForum = params => request.globalRequest(`/program/forum/praise`, 'PUT', params)
//赚钱分享社区,添加评论,(只有内容)
api.addForumCom = params => request.globalRequest(`/program/comment/add`, 'POST', params)
//赚钱分享社区,评论分页查询
api.getComList = params => request.globalRequest(`/program/comment/page${formatGetUri(params)}`, 'GET', {})
//评论点赞,取赞
api.praiseComment = params => request.globalRequest(`/program/comment/praiseComment/${params}`, 'POST', {})


/***************************订单页面一系列的接口*************************************/
//获取产列表
api.getProductList = () => request.globalRequest(`/order/listProduct`, 'GET', {})
//获取订单状态
api.getOrderState = () => request.globalRequest(`/order/state`, 'GET', {})
//获取经纪人数据
api.getTeamList = () => request.globalRequest(`/order/listTeam`, 'GET', {})
//订单查询分页,条件搜索
api.getOrderList = params => request.globalRequest(`/order/page${formatGetUri(params)}`, 'GET',{})
//添加订单
api.newOrder = params => request.globalRequest(`/order/save`, 'POST', params)
//查看订单详情
api.getOrderInfo = params => request.globalRequest(`/order/orderInfo/${params}`, 'GET', {})
/***************************团队界面user系列接口*************************************/
//合伙人查询个人信息
api.getTeamOwn = () => request.globalRequest(`/program/team/own`, 'GET', {})
//获取团队公告
api.getTeamNotice = () => request.globalRequest(`/program/team/notice`, 'GET', {})
//修改团队公布
api.updateTeamNotice = params => request.globalRequest(`/program/team/update/notice`, 'PUT', params)
//获取团队收益
api.getTeamIncome = params => request.globalRequest(`/program/team/earnings${formatGetUri(params)}`, 'GET', {})
//获取团队概述名称,介绍
api.getTeamIntro = () => request.globalRequest(`/program/team/introduce`, 'GET', {})
//修改团队名称
api.updateTeamName = params => request.globalRequest(`/program/team/update/name`, 'PUT', params)
//经纪人已加入:展示个人在团队中的排名
api.getTeamMemRank = () => request.globalRequest(`/program/team/member/rank`, 'GET', {})
//经纪人已加入:获取s等级
api.getTeamMemGrande = () => request.globalRequest(`/program/team/member/grade`, 'GET', {})
//经纪人已加入:团队奖金,团队业绩
api.getTeamMemGross = params => request.globalRequest(`/program/team/member/gross${formatGetUri(params)}`, 'GET', {})
//经纪人已加入:用来展示团队人员的个人订单收入信息
api.getTeamMemOrder = params => request.globalRequest(`/program/team/member/order${formatGetUri(params)}`, 'GET', {})
//经纪人未加入:获取附近团队
api.getTeamNear = params => request.globalRequest(`/program/team/nearby${formatGetUri(params)}`, 'GET', {})
//经纪人未加入:加入团队
api.joinTeamBy = params => request.globalRequest(`/program/team/join`, 'PUT', params)
//经纪人未加入:取消申请
api.cancelJoinTeam = () => request.globalRequest(`/program/team/cancel`, 'PUT', {})
//经纪人创建团队
api.createTeam = params => request.globalRequest(`/program/team/create`, 'POST', params)
//合伙人:同意,不同意,加入,退出
api.teamConsent = params => request.globalRequest(`/program/team/consent`, 'PUT', params)
//经纪人 申请退出团队
api.teamExit = params => request.globalRequest(`/program/team/apple/exit`, 'POST', params)
//经纪人加入官方团队
api.joinOfficial = params => request.globalRequest(`/program/team/joinOfficial`, 'POST', params)
//合伙人邀请成员、
// api.getTeamCode = () => request.globalRequest(`/program/team/getCode`, 'GET', {})
api.getTeamCode = () => request.globalRequest(`/program/team/getAppCode`, 'GET', {})
//获取是否是团员
api.getTeamFresh = () => request.globalRequest(`/fresh/states`, 'GET', {})

/***************************用户界面user系列接口*************************************/
//获取个人详情
api.getUserDetail = () => request.globalRequest(`/program/mine/detail`, 'GET', {})
//退出登录
api.logout = () => request.globalRequest(`/program/mine/logout`, 'POST', {})
//修改密码/添加新密码
api.updatePass = params => request.globalRequest(`/emp/updatePass`, 'PUT', params)
//获取用户信息
api.getUserInfor = () => request.globalRequest(`/emp/info`, 'GET', {})
//修改用户信息
api.updateUsertInfor = params => request.globalRequest(`/emp/change`, 'PUT', params)
//获取账户余额
api.getBalance = () => request.globalRequest(`/program/mine/balance`, 'GET', {})


/***************************下户调查工具系列接口*************************************/
//查看下户列表
api.getSurList = params => request.globalRequest(`/survey/taskPage`, 'POST', params)
//查看下户详情
api.getSurinfor = params => request.globalRequest(`/survey/appInfo/${params}`, 'GET', {})

/***************************银行卡系列接口*************************************/
//下拉银行卡类型
api.getBankTypeList = () => request.globalRequest(`/bank/listType`, 'GET', {})
//添加银行卡
api.addBankCard= params => request.globalRequest(`/bank/add`, 'POST', params)
//获取银行卡列表
api.getBankList = () => request.globalRequest(`/bank/list`, 'GET', {})
//删除银行卡
api.deleteBankCard = params => request.globalRequest(`/bank/del/${params}`, 'DELETE',{})
//申请提现
api.mineExtract= params => request.globalRequest(`/program/mine/applyExtract`, 'POST', params)
//提现详细
api.getExtractInfo = params => request.globalRequest(`/program/mine/extractInfo/${params}`, 'GET', {})
//提现列表
api.getExtraList = params => request.globalRequest(`/program/mine/recordExtract${formatGetUri(params)}`, 'GET', {})
//查询收支明细
api.getIncomeList = params => request.globalRequest(`/program/mine/incomePage${formatGetUri(params)}`, 'GET', {})
//我的推广
api.getMyPromotion = () => request.globalRequest(`/program/extension/getMyPromotion`, 'GET', {})

//佣金公示
api.getCommissionPublicity = () => request.globalRequest(`/program/extension/getCommissionPublicity`, 'GET', {})

//评论列表（赚钱社区，经纪人学院）
api.getCommentList = (data) => request.globalRequest(`/program/comment/page`, 'GET', data)

//帖子-点赞,取赞 ,赚钱分享社区0/经纪人学院1/ 类型区分
api.likeOrCancel = (data) => request.globalRequest(`/program/forum/praise`, 'PUT', data)

//二级评论点赞,取赞 （赚钱社区，经纪人学院）
api.level2LikeOrCancel = (id) => request.globalRequest(`/program/comment/praiseComment/${id}`, 'POST', {})

//评论--文字评论（赚钱社区，经纪人学院）
api.textReview = (data) => request.globalRequest(`/program/comment/add`, 'POST', data)

//评论--文字评论+图片（赚钱社区，经纪人学院）
api.addComment = (data) => request.globalRequest(`/program/comment/addComment`, 'POST', data)
//评论--获取上传oss凭证
api.getOssAuth = (data) => request.globalRequest(`/program/comment/getOssAuth`, 'GET', data)

//修改团队位置
api.updateLocation = (data) => request.globalRequest(`/program/team/update/location`, 'PUT', data)
//团队是否开放加入
api.isOpenJoin = () => request.globalRequest(`/program/team/isOpenJoin`, 'POST', {})
//获取用户信息
api.getInfo = () => request.globalRequest(`/program/empInfo`, 'GET', {})

//邀请注册-获取验证码
api.GetAutoRegisterCode = (phoneNumber) => request.globalRequest(`/app/auto/registerCode/${phoneNumber}`, 'GET', {});
//申请加入
api.registerAgent = (data) => request.globalRequest(`/app/auto/registerAgent`, 'POST', data)
//单个删除
api.msmsgDelByIdgById = (id) => request.globalRequest(`/msg/delById/${id}`, 'DELETE', {})
//单个标记已读
api.msgById = (id) => request.globalRequest(`/msg/byId/${id}`, 'GET', {})
//消息列表
api.getMessage = (data) => request.globalRequest(`/msg/page`, 'GET', data)
//标记已读
api.alreadyRead = () => request.globalRequest(`/msg/alreadyRead`, 'PUT', {})
//获取未读消息条数
api.getNotReadNum = (id) => request.globalRequest(`/msg/getNotReadNum`, 'GET', {})

//申请调查
api.surveyMake = (data) => request.globalRequest(`/survey/make`, 'PUT', data)

//取消调查
api.returned = (data) => request.globalRequest(`/survey/returned`, 'PUT', data)

//带调查详情
api.getAppInfo = (id) => request.globalRequest(`/survey/appInfo/${id}`, 'GET', {})
//到达目的地
api.isArrive = (data) => request.globalRequest(`/survey/isArrive`, 'GET', data)

//工具-下户工具:前端获取上传oss凭证
api.surveyGetMap = () => request.globalRequest(`/survey/getMap`, 'GET', {})
//工具-下户工具:oss附件成功后,添加后台数据
api.addArriveImg = (data) => request.globalRequest(`/survey/addArriveImg`, 'POST', data)
//提交调查
api.surveyAddData = (data) => request.globalRequest(`/survey/addData`, 'POST', data)
//下户详情
api.surveyDetail = (id) => request.globalRequest(`/survey/byId/${id}`, 'GET', {})
//字典
api.plainDictionary = (item) => request.globalRequest(`/dictItem/findByDictCode/${item}`, 'GET', {})
//获取朋友圈素材文案数据
api.getCopywritingData = (data) => request.globalRequest(`/program/product/getAppCopywritingData`, 'GET', data)
//查看海报推广线索,业绩展示
api.getExtensionShow = () => request.globalRequest(`/program/product/extensionShow`, 'GET', {})
//获取活动
api.getActivity = () => request.globalRequest(`/program/extension/isOpenActivity`, 'GET', {})
//获取朋友圈素材文案数据
api.getActivityPoster = () => request.globalRequest(`/program/extension/getActivityPoster`, 'GET', {})
//获取红包金额
api.getRedEnvelopesMoney = () => request.globalRequest(`/program/extension/getRedEnvelopesMoney`, 'GET', {})
//获取可领取红包次数
api.getRedEnvelopesTimes = () => request.globalRequest(`/program/extension/getRedEnvelopesTimes`, 'GET', {})

//邀请注册-邀请人信息
api.getRegisterEmpAppInfo = (id) => request.globalRequest(`/emp/getRegisterEmpAppInfo/${id}`, 'GET', {})

//工具-下户工具:查询当前用户有多少任务
api.getSurveyTaskNum = () => request.globalRequest(`/survey/getSurveyTaskNum`, 'GET', {})
//额外奖金订单
api.getBonusDetails = (data) => request.globalRequest(`/mine/bonusDetails`, 'GET', data)
//推广的经纪人
api.getPromotionalAgent = (data) => request.globalRequest(`/mine/promotionalAgent`, 'GET', data)
//团队数据统计
api.getBonus = () => request.globalRequest(`/mine/bonus`, 'GET', {})
//团队信息
api.getTeamInfo = () => request.globalRequest(`/program/team/introduce`, 'GET', {})

//获取推广nav
api.getProNav = () => request.globalRequest(`/program/extension/productListByClassification`, 'GET', {})

//获取分享加盟报名海报
api.getSignUpPoster = () => request.globalRequest(`/program/team/getSignUpPoster`, 'GET', {})

//获取下户基本信息
api.getSurveyDataBySid = (data) => request.globalRequest(`/survey/getSurveyDataBySid`, 'GET', data)

//上传基本信息
api.addSurveyData = (data) => request.globalRequest(`/survey/addSurveyData`, 'POST', data)

//获取下户图片
api.getSurveyAccessoryBySid = (data) => request.globalRequest(`/survey/getSurveyAccessoryBySidGroupByType`, 'GET', data)

//上传下户图片(单图片上传)-会返回图片id
api.addArriveImg2 = (data) => request.globalRequest(`/survey/addArriveImg2`, 'POST', data)

//获取签到照片
api.getArriveImg = (data) => request.globalRequest(`/survey/getArriveImg`, 'GET', data)


//工具-下户工具:删除附件
api.deleteImg = (id) => request.globalRequest(`/survey/deleteImg/${id}`, 'DELETE', {})

//获取用户是否上传数据(0正常，1未上传基本信息，2未上传下户图片)
api.getIsUploadData = (data) => request.globalRequest(`/survey/getIsUploadData`, 'GET', data)


//提交所有数据，到下一流程
api.surveyDataSubmit = (data) => request.globalRequest(`/survey/surveyDataSubmit`, 'POST', data)


//获取验证码
api.getAppraisalCode = (phoneNumber) => request.globalRequest(`/appraisal/getAppraisalCode/${phoneNumber}`, 'GET', {})

//提交测额信息
api.submitAppraisalInfo = (data) => request.globalRequest(`/appraisal/submitAppraisalInfo`, 'POST', data)

//申请提额/调额
api.applyQuota = (data) => request.globalRequest(`/appraisal/applyQuota`, 'POST', data)

//房源详情海报二维码
api.getHouseSharePoster = (id) => request.globalRequest(`/housing/getHouseSharePoster/${id}`, 'GET', {})

//积分商城个人信息
api.getPersonInfo = () => request.globalRequest(`/integralRecord/personInfo`, 'GET', {});

//今日是否签到
api.isSignToday = () => request.globalRequest(`/signin/isSignToday`, 'GET', {});

//签到
api.confirm = () => request.globalRequest(`/signin/confirm`, 'POST', {});

//商品分页列表
api.getCommodityInfo = (data) => request.globalRequest(`/commodityInfo/page`, 'GET', data);

//积分是否足够
api.isEnough = (cid) => request.globalRequest(`/commodityInfo/isEnough/${cid}`, 'GET', {});

//商品兑换
api.exchange = (data) => request.globalRequest(`/commodityInfo/exchange`, 'POST', data);

//查询积分汇总
api.integralSummary = () => request.globalRequest(`/integralRecord/integralSummary`, 'GET', {});
//积分明细列表
api.integralRecord = (data) => request.globalRequest(`/integralRecord/page`, 'GET', data);
//消息推送查询
api.queryMessage = () => request.globalRequest(`/html/apply/queryMessage`, 'GET', {});
//消息推送订单详情
api.getQuickAppyDetail = (id) => request.globalRequest(`/html/apply/getQuickAppyDetail/${id}`, 'GET', {});
//放弃订单
api.giveOrderApply = (id) => request.globalRequest(`/html/apply/giveOrderApply/${id}`, 'POST', {});

//订单跟进
api.followOrder = (id) => request.globalRequest(`/html/apply/followOrder/${id}`, 'POST', {});

export default api